<%@ page language="java" contentType="text/html;charset=utf-8"
	pageEncoding="utf-8"%>
<%@ page import="com.sms.day_report.*"%>
<%@ page import="net.sf.json.*"%>
<%@ page import="java.util.List,java.util.ArrayList"%>

<%--
	project/teacher/modify-time.jsp
 --%>
<%	//清除内存
	response.setHeader("Pragma","No-cache"); 
	response.setHeader("Cache-Control","no-cache"); 
	response.setDateHeader("Expires", 0); 
%>

<%
	request.setCharacterEncoding("utf-8");
	boolean isSuccess = true;
	String msg = "";
	
	System.out.println("ok");
	
	String content = new String(request.getParameter("content"));
	System.out.println(content);
   	String type = request.getParameter("type");
	System.out.println(type);
   	int rootID = Integer.parseInt(request.getParameter("rootid"));
	System.out.println(rootID);
   	int pid = Integer.parseInt(request.getParameter("pid"));
	System.out.println(pid);
   	String fromID = request.getParameter("fromid");
	System.out.println(fromID);
   	String toID = request.getParameter("toid");
	System.out.println(toID);
   	
   	Day_report nreport = new Day_report();
   	if(nreport.insertData(type, rootID, pid, fromID, toID, content)) {
   		isSuccess = true;
   	} else {
   		isSuccess = false;
   	}
	
	if(isSuccess) {
		msg = "ok";
	} else {
		msg = "error";
	}
	
	msg = msg.replace("/rn/g", "");//去掉产生的换行
	out.clear();
	out.print(msg);
%>